
global controls_obs zgender zage zeducation zformaleducation zunemployed zmarried zincome_std zcitizen zyear_inhost zreligiosity zsunni zlanguage_prof zgermany 
global outcomes zpolitical_interest zsup_participation_7


***Descriptive Statistics 
************
tab age, nolab
tab education
tab turkey
tab gender
tab germany
sum political_discourse_positive op_pol_1_positive gov_pol_1_positive if germany==1
sum political_discourse_positive op_pol_1_positive gov_pol_1_positive if germany==0
sum 


******Part 1: Manipulation checks


est clear  // clear the est locals
eststo: reg zpolitical_discourse ztreatment
estimates store turkish_pol_b

eststo: reg zpolitical_discourse ztreatment  $controls_obs
estimates store turkish_pol_f

eststo: reg zgov_pol_1 ztreatment 
estimates store gov_pol_1_b

eststo: reg zgov_pol_1 ztreatment  $controls_obs
estimates store gov_pol_1_f

eststo: reg zop_pol_1 ztreatment  
estimates store opp_pol_1_b

eststo: reg zop_pol_1 ztreatment  $controls_obs
estimates store opp_pol_1_f

esttab using figure1.rtf, se(3) b(a3)  title(Figure 1: The effect of the treatment on the perceptions of elite attitudes among Syrian refugees) addnote("OLS Regressions. All values are standardized.") mtitles("Hostility in Discourse: General" "Hostility in Discourse: General" "Hostility in  Discourse: Government" "Hostility in  Discourse: Government" "Hostility in  Discourse: Opposition" "Hostility in  Discourse: Opposition") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label compress nogaps noconstant replace



set scheme plotplain
coefplot   (turkish_pol_b, label (No Controls) keep (ztreatment) levels(95 90)) (turkish_pol_f, label (Controls Added) keep (ztreatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Perceptions: General) || (gov_pol_1_b, keep (ztreatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (gov_pol_1_f, keep (ztreatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Perceptions: Government)  || (opp_pol_1_b, keep (ztreatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (opp_pol_1_f, keep (ztreatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Perceptions: Opposition)  ||, drop(_cons) xline(0)   byopts(compact cols(3)) subtitle(, color(black) bcolor(white))




********
********
*MAIN RESULTS
********
********

est clear
eststo m4: reg zpolitical_interest ztreatment  
eststo m1: reg zpolitical_interest zpolitical_discourse $controls_obs 
eststo m2: reg zpolitical_interest zgov_pol_1 $controls_obs 
eststo m3: reg zpolitical_interest zop_pol_1 $controls_obs     
eststo m5: reg zpolitical_interest ztreatment $controls_obs  

eststo m9: reg zsup_participation_7 ztreatment  
eststo m6: reg zsup_participation_7 zpolitical_discourse $controls_obs  
eststo m7: reg zsup_participation_7 zgov_pol_1 $controls_obs 
eststo m8: reg zsup_participation_7 zop_pol_1 $controls_obs   
eststo m10: reg zsup_participation_7 ztreatment $controls_obs  

eststo m14: reg zvote_turnout ztreatment  
eststo m11: reg zvote_turnout zpolitical_discourse $controls_obs  
eststo m12: reg zvote_turnout zgov_pol_1 $controls_obs 
eststo m13: reg zvote_turnout zop_pol_1 $controls_obs   
eststo m15: reg zvote_turnout ztreatment $controls_obs 

esttab m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14 m15 using "regression.rtf",   replace label  onecell b(2) se(2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) order(ztreatment zpolitical_discourse zgov_pol_1 zop_pol_1) noconstant mgroups("Pol. Interest" "Participation" "Vot", pattern(1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 )) nomtitle title ("Table")


***Mediation analysis

medeff (regress  zpolitical_discourse ztreatment)  (regress  zinterest zpolitical_discourse ztreatment),  treat(ztreatment) mediate(zpolitical_discourse)

medeff (regress  zpolitical_discourse ztreatment)  (regress  zsup zpolitical_discourse ztreatment),  treat(ztreatment) mediate(zpolitical_discourse)

***Table 2

est clear
eststo m4: reg zreturn12 ztreatment  
eststo m1: reg zreturn12 zpolitical_discourse $controls_obs 
eststo m2: reg zreturn12 zgov_pol_1 $controls_obs 
eststo m3: reg zreturn12 zop_pol_1 $controls_obs     
eststo m5: reg zreturn12 ztreatment $controls_obs  

eststo m9: reg zhope ztreatment  
eststo m6: reg zhope zpolitical_discourse $controls_obs  
eststo m7: reg zhope zgov_pol_1 $controls_obs 
eststo m8: reg zhope zop_pol_1 $controls_obs   
eststo m10: reg zhope ztreatment $controls_obs  


esttab m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 using "regression.rtf",   replace label  onecell b(2) se(2) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) order(ztreatment zpolitical_discourse zgov_pol_1 zop_pol_1) noconstant mgroups("return" "hope", pattern(1 0 0 0 0 1 0 0 0 0 )) nomtitle title ("Table 2: The correlates and causes of the intentions and willingness for return")

*****END OF MAIN TEXT*****
*****************
****************





* Part 2: Exit or Voice

est clear  // clear the est locals
eststo: reg zinterest treatment 
estimates store political_interest_b

eststo: reg zinterest treatment  $controls
estimates store political_interest_f

eststo: reg zsup treatment 
estimates store sup_participation_b

eststo: reg zsup treatment  $controls
estimates store sup_participation_f


eststo: reg zreturn12 treatment  
estimates store return_12months_b

eststo: reg zreturn12 treatment  $controls
estimates store return_12months_f

eststo: reg zhope treatment  
estimates store return_hope_b

eststo: reg zhope treatment  $controls
estimates store return_hope_f



esttab using figure2.rtf, se(3) b(a3)  title(Figure 2: The effect of the treatment on political interest, participation, and willingness to return to Syria) addnote("All values are standardized") mtitles("Political interest" "Political interest"  "Syrian participation" "Syrian participation" "Plan to return" "Plan to return" "Hope to return" "Hope to return") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label compress nogaps noconstant replace



coefplot   (political_interest_b, label (No Controls) keep (treatment) levels(95 90)) (political_interest_f, label (Controls Added) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Political Interest) || (sup_participation_b, label (No Controls) keep (treatment) levels(95 90)) (sup_participation_f, label (Controls Added) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Syrian Participation) || (return_12months_b, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_12months_f, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: 12 Months)  || (return_hope_b, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_hope_f, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: Hope)  ||, drop(_cons) xline(0)   byopts(compact cols(2)) subtitle(, color(black) bcolor(white))

******ROBUSTNESS CHECKS - 1 ******

* Countries seperate, with controls

* Upload the data file again
 
est clear  // clear the est locals


eststo: reg zinterest treatment  $controls if turkey==1
estimates store political_interest_t

eststo: reg zinterest treatment  $controls if turkey==0
estimates store political_interest_g

eststo: reg zsup treatment  $controls if turkey==1
estimates store sup_participation_t

eststo: reg zsup treatment  $controls if turkey==0
estimates store sup_participation_g

eststo: reg zreturn12 treatment  $controls if turkey==1
estimates store return_12months_t

eststo: reg zreturn12 treatment  $controls if turkey==0
estimates store return_12months_g

eststo: reg zhope treatment  $controls if turkey==1
estimates store return_hope_t

eststo: reg zhope treatment  $controls if turkey==0
estimates store return_hope_g


set scheme plotplain

coefplot   (political_interest_t, label (Turkey) keep (treatment) levels(95 90)) (political_interest_g, label (Germany) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Political Interest) || (sup_participation_t, label (Turkey) keep (treatment) levels(95 90)) (sup_participation_g, label (Germany) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Syrian Participation) || (return_12months_t, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_12months_g, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: 12 Months)  || (return_hope_t, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_hope_g, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: Hope)  ||, drop(_cons) xline(0)   byopts(compact cols(2)) subtitle(, color(black) bcolor(white))



* Countries seperate, without controls

* Upload the data file again
 
est clear  // clear the est locals


eststo: reg zinterest treatment   if turkey==1
estimates store political_interest_t

eststo: reg zinterest treatment   if turkey==0
estimates store political_interest_g

eststo: reg zsup treatment   if turkey==1
estimates store sup_participation_t

eststo: reg zsup treatment   if turkey==0
estimates store sup_participation_g

eststo: reg zreturn12 treatment   if turkey==1
estimates store return_12months_t

eststo: reg zreturn12 treatment   if turkey==0
estimates store return_12months_g

eststo: reg zhope treatment   if turkey==1
estimates store return_hope_t

eststo: reg zhope treatment   if turkey==0
estimates store return_hope_g


set scheme plotplain

coefplot   (political_interest_t, label (Turkey) keep (treatment) levels(95 90)) (political_interest_g, label (Germany) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Political Interest) || (sup_participation_t, label (Turkey) keep (treatment) levels(95 90)) (sup_participation_g, label (Germany) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Syrian Participation) || (return_12months_t, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_12months_g, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: 12 Months)  || (return_hope_t, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_hope_g, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: Hope)  ||, drop(_cons) xline(0)   byopts(compact cols(2)) subtitle(, color(black) bcolor(white))





* Only complete responses

* Upload the data file again
keep if Progress==100

est clear  // clear the est locals
eststo: reg zinterest treatment 
estimates store political_interest_b

eststo: reg zinterest treatment  $controls
estimates store political_interest_f

eststo: reg zsup treatment 
estimates store sup_participation_b

eststo: reg zsup treatment  $controls
estimates store sup_participation_f


eststo: reg zreturn12 treatment  
estimates store return_12months_b

eststo: reg zreturn12 treatment  $controls
estimates store return_12months_f

eststo: reg zhope treatment  
estimates store return_hope_b

eststo: reg zhope treatment  $controls
estimates store return_hope_f



*esttab using figure2.rtf, se(3) b(a3)  title(Figure 2: The effect of the treatment on political interest, participation, and willingness to return to Syria) addnote("All values are standardized") mtitles("Political interest" "Political interest"  "Syrian participation" "Syrian participation" "Plan to return" "Plan to return" "Hope to return" "Hope to return") star(+ 0.10 * 0.05 ** 0.01 *** 0.001) label compress nogaps noconstant replace



coefplot   (political_interest_b, label (No Controls) keep (treatment) levels(95 90)) (political_interest_f, label (Controls Added) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Political Interest) || (sup_participation_b, label (No Controls) keep (treatment) levels(95 90)) (sup_participation_f, label (Controls Added) keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Syrian Participation) || (return_12months_b, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_12months_f, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: 12 Months)  || (return_hope_b, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))) (return_hope_f, keep (treatment) levels(95 90)  mlabposition(1) mlabgap(*2) mlabel("{it:p} = " + string(@pval,"%9.3f"))), bylabel (Return: Hope)  ||, drop(_cons) xline(0)   byopts(compact cols(2)) subtitle(, color(black) bcolor(white))
*graph export "${overleaf}manipulationgraphs.pdf", as (pdf) replace

















  